package org.rcgwt.client.ui.grid.internal;

import org.rcgwt.client.ui.grid.internal.model.IElementModel;

/**
 * 
 * @author oeuillot
 * 
 */
public class ShowModelElementDelta<T extends IElementModel> extends
		DefaultModelElementDelta<T> {

	private IElementModel showElementModel;

	protected ShowModelElementDelta(T elementModel) {
		super(elementModel);
	}

	public void showElementModel(IElementModel showElementModel) {
		if (isElementModelTypeValid(showElementModel)) {
			this.showElementModel = showElementModel;
			return;
		}

		throw new IllegalArgumentException("Can not show modelElement="
				+ showElementModel);
	}

	protected boolean isElementModelTypeValid(IElementModel elementModel) {
		return false;
	}

	public IElementModel getShowElementModel() {
		return showElementModel;
	}
}
